//单价，数量，钱数
var price = 28;
var count = 30;
var money = 500;
//如果商品的总价大于等于500，打8折
var total = price*count;
if(total >= 500){
  //打8折
  total = total * 0.8;
}
//付钱，涉及到找零
//判断钱数是否大于等于总价
//大于总价，打印总价，找零
//否则，错误提示
if(money >= total){
  //满足钱数大于等于总价，才会计算找零
  var rest = money-total;
  console.log('总价为:'+total+'元');
  console.log('找零为:'+rest+'元');
}else{
  //钱数不够付款
  console.log('error,余额不足');
}











